package com.lizhenhua.stockupdate.controller;

import com.lizhenhua.fmmall.entity.ProductSku;

import com.lizhenhua.stockupdate.service.StockUpdateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/stock-update")
public class StockUpdateController {

    @Autowired
    private StockUpdateService service;

    @PutMapping("/update")
    public int update(@RequestBody List<ProductSku> skus) {
        System.out.println("------------stockUpdate");

        int i = service.updateStock(skus);
        return i;
    }
}
